<?php

function dtxx($data_list,$dtxx_msg='',$dtxx_url=''){
	global $currentdate;
$return=print<<<GH
<table width="100%"  border="0" cellpadding="0">
<tr class="redb">
    <td height="40" valign="middle" class="dantiaokuan">
	<!-- $dtxx_msg -->
    <img src="/images/spacer.gif" width="80" height="1" />
	$dtxx_msg<img src="/images/spacer.gif" width="120" height="1" />
	<a href="$dtxx_url"  target="_blank">更多</a></td>
  </tr>
  <tr class="fawenbg">
    <td height="200" valign="top">
<table width="100%"  border="0" cellpadding="0" cellspacing="3" class="indexlmtext">
            <tr align="left" height="2">
        <td height="2"></td>
        <td height="2"></td>
      </tr>
GH;
	foreach($data_list as $zywd){
	$msg=$title='';
$return.=print<<<GH
      <tr align="left">
        <td width="86%">&middot;
GH;

			if(strlen($zywd['title'])>25){
				$title=cutstr($zywd['title'],24);
			}else{
				$title=$zywd['title'];
			}
		$msg="<a href='/shownews.php?id=".$zywd['id']."'  target='_blank' title='标题：".$zywd['title']." &#13;&#10;录入：".$zywd['author']."&#13;&#10;日期：".$zywd['tdate']."' class='dong'>".$title."</a>";
		if($currentdate>=$zywd['tdate'])
		$msg.="<img src='/images/new.gif' width='23' height='16' border='0' />";
$datas=date('m-d',strtotime($zywd['tdate']));

$return.=print<<<GH
$msg</td>
        <td widzh="14%">$datas</td>
</tr>
GH;
		 }
$return.=print<<<GH
    </table> 
  </tr>
</table>
GH;
}

/*
*读取指定新闻信息
*根据指定ID值
*/
function news($id=0){//
    global $db;
	$news=array();
	$id=intval($id);
	if(!$id) return $news;
	$sql="select * from bl_dzgg where id='$id'";
	$news=$db->fetch_first($sql);
	return $news;
} // end func

/*
*读取指定类别新闻列表
*根据指定type值
*/
function newlist($sql){//
    global $db;
	$news=array();
//	$sql="select id,title,author,tdate,jian,ishit from bl_dzgg $where $order";
//	echo "\nsql".$sql;
	$news=$db->fetch_all($sql);
	return $news;
} // end func

/*读取介绍信息*/
function abouts($id){//
    global $db;
	$id=intval($id)==0?1:intval($id);
	$news=array();
	$where='';
	$sql="select title,buid from bl_bzjj ";
	$news['all']=$db->fetch_all($sql);
	$sql="select title,content,buid from bl_bzjj where buid=$id";
//	echo "\nsql".$sql;
	$news['list']=$db->fetch_first($sql);
	if(empty($news['list'])){
		return array();
	}else{
		return $news;
	}
} // end func

/*读取生产日况信息*/
function products($id){//
    global $db;
	$id=intval($id)==0?1:intval($id);
	$news=array();
	$where='';
	$sql="select title,buid from bl_bzjj ";
	$news['all']=$db->fetch_all($sql);
	$sql="select title,content,buid from bl_bzjj where buid=$id";
//	echo "\nsql".$sql;
	$news['list']=$db->fetch_first($sql);
	if(empty($news['list'])){
		return array();
	}else{
		return $news;
	}
} // end func

?>